/**
 * Project: push-center-biz-core
 * 
 * File Created at 2014年10月9日
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package com.greenline.push.core.pushcenter.impl;

import javax.annotation.Resource;

import com.greenline.push.core.pushcenter.GroupManager;
import com.greenline.push.dal.pushcenter.GroupDAO;
import com.greenline.push.dal.pushcenter.dataobject.GroupDO;
import com.greenline.push.dal.query.GroupQuery;

/**
 * @Type GroupManagerImpl
 * @Desc
 * @author zhaoli
 * @date 2014年10月9日
 * @Version V1.0
 */
public class GroupManagerImpl implements GroupManager {
	@Resource
	private GroupDAO groupDAO;

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.greenline.push.core.pushcenter.GroupManager#insert(com.greenline.
	 * push.dal.pushcenter.dataobject.GroupDO)
	 */
	@Override
	public Long insert(GroupDO group) {
		return groupDAO.insert(group);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.greenline.push.core.pushcenter.GroupManager#getGroupById(java.lang
	 * .Long)
	 */
	@Override
	public GroupDO getGroupById(Long id) {
		return groupDAO.getGroupById(id);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.greenline.push.core.pushcenter.GroupManager#update(com.greenline.
	 * push.dal.pushcenter.dataobject.GroupDO)
	 */
	@Override
	public boolean update(GroupDO group) {
		return groupDAO.update(group) > 0;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.greenline.push.core.pushcenter.GroupManager#listByQuery(com.greenline
	 * .push.dal.query.GroupQuery)
	 */
	@Override
	public GroupQuery listByQuery(GroupQuery query) {
		return groupDAO.listByQuery(query);
	}

	/* (non-Javadoc)
	 * @see com.greenline.push.core.pushcenter.GroupManager#listByQuery(java.lang.Long)
	 */
	@Override
	public boolean delete(Long id) {
		return groupDAO.delete(id) > 0;
	}

    @Override
    public GroupDO getByGName(String name) {
        return groupDAO.getByGName(name);
    }
}
